<!DOCTYPE html><html><head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
	<title>退货</title>
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/sendout.css" rel="stylesheet" type="text/css">
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/common.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>
    <script type="text/javascript">

        $(function () {
            //选中上次使用的快递公司
            $('.deliverySelected').on('click', function (e) {
                if ($('.deliveryList').css('display') == 'none') {
                    $('.deliveryList').css('display', 'table');
                } else {
                    $('.deliveryList').css('display', 'none');
                }
            });
			
            $('.deliveryItem').on('click', function (e) {
                if($(this).attr('com') != "") {
                    $('.deliverySelected').html($(this).html());
                    $('#com').val($(this).attr('com'));
                }
                $('.deliveryList').css('display', 'none');
            });


            $('.submitBtn').click(function(){
				var order_id = '<?php echo $_GET['order_id'];?>';
				var code = $('#code').val();
				var com = $('#com').val();
				if($('#faceTrade').attr('checked')){
					var is_express = 2;
				}else{
					var is_express = 1;
				}
				
				if(code == ''){
					alert('运单号不能为空');
					return false;
				}

				if(com == ''){
					alert('快递公司不能为空');
					return false;
				}
				
				$.ajax({
					type:'post',
					url:'index.php?act=order&op=lijituihuo',
					data:{order_id:order_id,code:code,com:com,is_express:is_express},
					dataType:'json',
					success:function(data){
						if(data.state){
							location.href = 'index.php?act=order&op=orderuserdetail&order_id='+order_id;
							return false;
						}
					}
				});
				
            });

            $('#faceTrade').click(function () {
                if($(this).attr('checked')){
                	$('.deliveryMain').hide(); 
                }else{
                    $('.deliveryMain').show();
                }
            });
        });
    </script>
</head>
<body>
<div id="contentbox" style="min-height: 576px;">
    <div class="saleMain">
        <div class="title">拍品信息</div>
        <div class="goodInfo">
            <div class="img" style="background-image: url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$output['auction']['auction_add_date'].'/'.$output['auction']['auction_img1'];?>);"></div>
            <div class="desc"><?php echo bearshop_auction_description_substr($output['auction']['auction_description']);?></div>
            <div class="expressFee"><span>成交金额：</span><span>¥<?php echo $output['order']['price']?>元</span></div>
            <div class="endTime"><span>同意退货：</span><span><?php echo date("m月d日 H:i",$output['order']['tuihuo_time']);?></span></div>
        </div>
    </div>

    <div class="addressMain">
        <div class="title">卖家退货地址</div>
        <div class="userInfo">
            <span>收货人：<?php echo $output['address']['name'];?></span><span><?php echo $output['address']['tele'];?></span>
        </div>
        <div class="addressInfo">
        	<?php echo $output['address']['prov_name'];?>
            <?php echo $output['address']['city_name'];?>
           	<?php echo $output['address']['dis_name'];?>
        	<?php echo $output['address']['address'];?>
        </div>
    </div>

    <div class="deliveryMain">
        <div class="deliveryCom">
            <span>快递公司</span>
            <div class="deliverySelected">
                请选择快递公司
            </div>
            <div class="deliveryList">
                                        <div class="deliveryItem" id="com_shunfeng" com="顺丰">顺丰</div>
                                        <div class="deliveryItem" id="com_shentong" com="申通">申通</div>
                                        <div class="deliveryItem" id="com_yuantong" com="圆通速递">圆通速递</div>
                                        <div class="deliveryItem" id="com_yunda" com="韵达快运">韵达快运</div>
                                        <div class="deliveryItem" id="com_huitongkuaidi" com="汇通快运">汇通快运</div>
                                        <div class="deliveryItem" id="com_zhongtong" com="中通速递">中通速递</div>
                                        <div class="deliveryItem" id="com_ems" com="ems快递">ems快递</div>
                                        <div class="deliveryItem" id="com_tiantian" com="天天快递">天天快递</div>
                                        <div class="deliveryItem" id="com_zhaijisong" com="宅急送">宅急送</div>
                                        <div class="deliveryItem" id="com_quanfengkuaidi" com="全峰快递">全峰快递</div>
                                        <div class="deliveryItem" id="com_youshuwuliu" com="优速物流">优速物流</div>
                                        <div class="deliveryItem" id="com_debangwuliu" com="德邦物流">德邦物流</div>
                                        <div class="deliveryItem" id="com_annengwuliu" com="安能物流">安能物流</div>
                                        <div class="deliveryItem" id="com_kuaijiesudi" com="快捷速递">快捷速递</div>
                                        <div class="deliveryItem" id="com_guotongkuaidi" com="国通快递">国通快递</div>
                            </div>
            <input type="hidden" name="com" id="com" value="">
        </div>

        <div class="deliveryCode">
            <span>运单号</span>
            <input type="text" name="code" id="code" value="" placeholder="请填写运单号">
            <img src="<?php echo TEMPLATE_SITE_URL;?>/images/smark.png" width="35" height="35" class="smark" id="saoma">
        </div>
    </div>

    <div class="doMain">
        <button class="submitBtn">确认退货</button>
    </div>
</div>

</body>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
wx.config({
    appId: '<?php echo $output['signPackage']["appId"];?>',
    timestamp: <?php echo $output['signPackage']["timestamp"];?>,
    nonceStr: '<?php echo $output['signPackage']["nonceStr"];?>',
    signature: '<?php echo $output['signPackage']["signature"];?>',
   jsApiList: [
               'checkJsApi',
               'onMenuShareTimeline',
               'onMenuShareAppMessage',
               'onMenuShareQQ',
               'onMenuShareWeibo',
               'hideMenuItems',
               'showMenuItems',
               'hideAllNonBaseMenuItem',
               'showAllNonBaseMenuItem',
               'translateVoice',
               'startRecord',
               'stopRecord',
               'onRecordEnd',
               'playVoice',
               'pauseVoice',
               'stopVoice',
               'uploadVoice',
               'downloadVoice',
               'chooseImage',
               'previewImage',
               'uploadImage',
               'downloadImage',
               'getNetworkType',
               'openLocation',
               'getLocation',
               'hideOptionMenu',
               'showOptionMenu',
               'closeWindow',
               'scanQRCode',
               'chooseWXPay',
               'openProductSpecificView',
               'addCard',
               'chooseCard',
               'openCard'
      ]
  });

wx.ready(function () {
	$('#saoma').click(function(){
		wx.scanQRCode({
		    needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
		    scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
		    success: function (res) {
		    var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
		    var bool = result.indexOf(",");
			if(bool==-1){
				$('#code').val(result);
			}else{
				var arr = result.split(',');
				$('#code').val(arr[1]);
			}
		    
		    
		}
		});	
	});
})
</script>

</html>